module Yahtzee

  class UpperScore < Yahtzee::Score

	def initialize(turn,number)
      super(turn)
      @number = number
    end
	 
    def odds
      total = dice.to_hash[@number]
      if total >= 3
        return 1
      elsif turn.over? 
        return 0
      elsif total == 2
        return 0.52
      elsif total == 1
        return 0.19
      else
        return 0.0
      end    
    end
	
	def points
	  dice.to_hash[@number] * @number
	end
	  
	def optional_roll?
	  !(dice.to_hash[@number] == 6)  
	end
  end
end